/*
 * base_singleton.cpp
 *
 *  Created on: 2014. 3. 27.
 *      Author: wooyoung
 */

#include "base_singleton.h"

template <class type>
type* BaseSingleton<type>::getInstancePointer()
{
	if (instance_ == NULL) {
		instance_ = new type();
	}

	return instance_;
}

template <class type>
type& BaseSingleton<type>::getInstance()
{
	if (instance_ == NULL) {
		instance_ = new type();
	}

	return *instance_;
}

template <class type>
bool BaseSingleton<type>::releaseInstance()
{
	if (instance_ == NULL) {
		return false;
	} else {
		delete instance_;
		instance_ = NULL;
		return true;
	}
}
